import Cookies from 'js-cookie';

const user = {
    state: {
        info: {}
    },
    mutations: {
        logout (state, vm) {
            Cookies.remove('user');
            Cookies.remove('password');
            Cookies.remove('access');
            localStorage.clear();
        },
        setUserInfo (state, info) {
            if(info instanceof Object) {
                state.info = info;
            }else {
                state.info = {};
            }
        }
    }
};

export default user;
